package com.nix.maze;

/**
 * @author zhangpei
 * @Email zhangpe0312@qq.com
 * @day 2017/12/3 18:06
 * @Use 格子类，生成最小的格子单位，每个格子里面可以放
 * 道具也可以不放道具
 * value 这个格子代表的值
 * classzz 这个格子装的类
 * xAddress 这个格子的X坐标
 * yAddress 这个格子的Y坐标
 */
public class Lattice {
    private String value;
    private String classzz;
    private Integer xAddress;
    private Integer yAddress;
    private Integer direction;

    public Lattice() {
    }

    public Lattice(String value, String classzz, Integer xAddress, Integer yAddress,Integer direction) throws Exception {
        if (value == null || value.equals("") || classzz == null || classzz.equals("")) {
            throw new Exception("value 和 classzz 不能为空或者null！");
        }
        if (xAddress < 0 || yAddress < 0) {
            throw new Exception("坐标不能小于0!");
        }
        String str = "|" + value + "->";
        this.value = str;
        this.classzz = classzz;
        this.xAddress = xAddress;
        this.yAddress = yAddress;
        this.direction = direction;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        String str = "|" + value + "->";
        this.value = str;
    }

    public String getClasszz() {
        return classzz;
    }

    public void setClasszz(String classzz) {
        this.classzz = classzz;
    }

    public Integer getxAddress() {
        return xAddress;
    }

    public void setxAddress(Integer xAddress) {
        this.xAddress = xAddress;
    }

    public Integer getyAddress() {
        return yAddress;
    }

    public void setyAddress(Integer yAddress) {
        this.yAddress = yAddress;
    }

    public Integer getDirection() {
        return direction;
    }

    public void setDirection(Integer direction) {
        this.direction = direction;
    }

    @Override
    public String toString() {
        return "Lattice{" +
                "value='" + value + '\'' +
                ", classzz='" + classzz + '\'' +
                ", xAddress=" + xAddress +
                ", yAddress=" + yAddress +
                ", direction=" + direction +
                '}';
    }
}
